<template>
    <div class="news">
        <ul>
           <li v-for="news in newsList" :key="news.id">
            <RouterLink to="/news/detail">{{news.title}}</RouterLink>
           </li>
        </ul>

        <div class="news-content">
            <RouterView></RouterView>
        </div>
    </div>
</template>

<script lang="ts" setup name="News">
    import { reactive } from 'vue';
    import { RouterView } from 'vue-router';
    import { RouterLink } from 'vue-router';

    const newsList = reactive([
        {id:'1', title:'java', content:'企业应用开发'},
        {id:'2', title:'vue', content:'前端编程'},
        {id:'3', title:'python', content:'动态语言'},
        {id:'4', title:'c', content:' c语言，性能好'}

    ])
</script>

<style scoped>
.news {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    height: 100%;
}
.news ul {
    margin-top: 30px;
    list-style: none;
    padding-left: 10px;
}
.news li> a {
    font-size: 18px;
    line-height: 40px;
    text-decoration: none;
    color: #64967E;
    text-shadow: 0 0 1px rgb(0, 84, 0);
}

.news-content {
    width: 70%;
    height: 90%;
    border: 1px solid;
    margin-top: 20px;
    border-radius: 10px;
}
</style>